package com.youkeyi.ddy.cloud.common.api.application.applet.system.todo;

import com.youkeyi.ddy.cloud.common.api.application.applet.system.todo.dto.AppletTodoListCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.applet.system.todo.param.AppletTodoCreateCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.applet.system.todo.param.AppletTodoDeleteCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.applet.system.todo.param.AppletTodoListCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.applet.system.todo.param.AppletTodoUpdateCloudParam;
import com.youkeyi.ddy.cloud.common.response.ResponseContent;
import io.swagger.annotations.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 系统待办提醒
 *
 * @author liuxiawang
 * @Date 5/24/22 10:36 PM
 * @Location shenzhen.china
 */
@Api(tags = {"User Todo"})
@RestController
@FeignClient(value = "YOUKEYI-DDY-CLOUD-APPLICATION-APPLET", fallback = AppletTodoCloudServiceFallback.class)
@RequestMapping("/applet/todo")
public interface AppletTodoCloudService {

    // 查询待办提醒列表
    @ApiOperation(value = "Query Todo List", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.applet.system.todo.AppletTodoCloudService.todoList")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = AppletTodoListCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query Todo List", dataType = "AppletTodoListCloudParam", dataTypeClass = AppletTodoListCloudParam.class),
    })
    @GetMapping("/todo")
    public abstract AppletTodoListCloudDto todoList(AppletTodoListCloudParam param);

    // 查询已办列表
    @ApiOperation(value = "Query Done List", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.applet.system.todo.AppletTodoCloudService.doneList")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = AppletTodoListCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query Done List", dataType = "AppletTodoListCloudParam", dataTypeClass = AppletTodoListCloudParam.class),
    })
    @GetMapping("/done")
    public abstract AppletTodoListCloudDto doneList(AppletTodoListCloudParam param);
    
    
    // 编辑待办提醒
    @ApiOperation(value = "Update Todo", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.applet.system.todo.AppletTodoCloudService.finish")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Update Todo", dataType = "AppletTodoUpdateCloudParam", dataTypeClass = AppletTodoUpdateCloudParam.class),
    })
    @PatchMapping("/finish")
    public abstract ResponseContent finish(@RequestBody AppletTodoUpdateCloudParam param);


    // 创建待办提醒
    @ApiOperation(value = "Create Todo", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.applet.system.todo.AppletTodoCloudService.create")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Create Todo", dataType = "AppletTodoCreateCloudParam", dataTypeClass = AppletTodoCreateCloudParam.class),
    })
    @PostMapping("/create")
    public abstract ResponseContent create(@RequestBody AppletTodoCreateCloudParam param);


    // 删除待办提醒
    @ApiOperation(value = "Delete Todo", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.applet.system.todo.AppletTodoCloudService.delete")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Delete Todo", dataType = "AppletTodoDeleteCloudParam", dataTypeClass = AppletTodoDeleteCloudParam.class),
    })
    @DeleteMapping("/delete")
    public abstract ResponseContent delete(AppletTodoDeleteCloudParam param);

}
